package com.xoa.controller.property;

import com.xoa.model.property.Atab;
import com.xoa.model.property.Maintain;
import com.xoa.service.property.MaintainService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RequestMapping("/Maintain")
public class MaintainController {
    @Autowired
    MaintainService maintainService;


    /**
     * @作者：陈玲
     * @时间：2018/7/16
     * @介绍: 跳转维修界面
     * @参数:id
     */
    @RequestMapping("/fixAssetsMaintain")
    public String fixAssetsMaintain() {
        return "app/FixAssets/eduFixAssets/fixAssetsMaintainDetail";

    }
    /**
     * @作者：陈玲
     * @时间：2018/7/16
     * @介绍: 新增维修
     * @参数:
     */
    @ResponseBody
    @RequestMapping("/insertSelective")
    public ToJson<Object> insertSelective(Maintain record,String id){
        ToJson<Object> toJson=maintainService.insertSelective ( record,id);
        return toJson;
    }

    /**
     * @作者：陈玲
     * @时间：2018/7/16
     * @介绍: 查询维修
     * @参数:
     */
    @ResponseBody
    @RequestMapping("/selectByPrimaryKey")
    public ToJson<Object>  selectByPrimaryKey(Integer id) {

        ToJson<Object> toJson = maintainService.selectByPrimaryKey (id);
        return toJson;

    }

    /**
     * @作者：陈玲
     * @时间：2018/7/16
     * @介绍: 删除维修
     * @参数:id
     */
    @ResponseBody
    @RequestMapping("/deleteByPrimaryKey")
    public ToJson<Object> deleteByPrimaryKey(Integer id) {
        ToJson<Object> toJson = maintainService.deleteByPrimaryKey(id);
        return toJson;
    }

    /**
     * @作者：陈玲
     * @时间：2018/7/16
     * @介绍: 修改维修
     * @参数:
     */
    @ResponseBody
    @RequestMapping("/updateByPrimaryKeySelective")
    public ToJson<Object>  updateByPrimaryKeySelective(Maintain record){
        ToJson<Object> toJson = maintainService.updateByPrimaryKeySelective(record);
        return toJson;
    }

    /**
     * @作者：陈玲
     * @时间：2018/7/16
     * @介绍: 查询全部维修
     * @参数:
     */
    @ResponseBody
    @RequestMapping("/selectByExample")
    public ToJson<Maintain>  selectByExample(Maintain record,String uid){
        ToJson<Maintain > toJson = maintainService.selectByExample (record,uid);
        return toJson;
    }


}
